package com.topisv.tms.repository.lightShelf;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.lightShelf.LightShelfStock;

/**
 * 灯光架位_DAO
 * @author ch
 *
 */
public abstract interface LightShelfStockDao extends PagingAndSortingRepository<LightShelfStock, Long>, JpaSpecificationExecutor<LightShelfStock>
{

	@Query("select t from LightShelfStock t where t.lightShelf.id=?")
	List<LightShelfStock> loadStock(Long shelfId);

	@Query("select t from LightShelfStock t where t.lightShelf.id=?1 and t.stockCode=?2")
	LightShelfStock loadStockByCondition(Long shelfId,String stockCode);

	@Query("select t from LightShelfStock t where t.lightShelf.id=?")
	List<LightShelfStock> loadByShelfId(Long shelfId);
}